using Unity.VisualScripting;

namespace LS.UGFUnits
{
    public class SetVariant : ResourceUnit
    {
        public ValueInput CurrentVariant { get; set; }

        protected override void Definition()
        {
            base.Definition();
            CurrentVariant = ValueInput<string>(nameof(CurrentVariant));
        }

        protected override ControlOutput In(Flow flow)
        {
            string variant = flow.GetValue<string>(CurrentVariant);
            Target?.SetCurrentVariant(variant);
            return base.In(flow);
        }
    }
}